home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / PInterfaces / Slots.p < prev    next >
Text File  |  1996-05-01  |  14KB  |  414 lines

  1. {
  2.      File:        Slots.p
  3.  
  4.      Contains:    Slot Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT Slots;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __SLOTS__}
  28. {$SETC __SLOTS__ := 1}
  29.  
  30. {$I+}
  31. {$SETC SlotsIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __TYPES__}
  35. {$I Types.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __EVENTS__}
  38. {$I Events.p}
  39. {$ENDC}
  40. {$IFC UNDEFINED __OSUTILS__}
  41. {$I OSUtils.p}
  42. {$ENDC}
  43. {$IFC UNDEFINED __FILES__}
  44. {$I Files.p}
  45. {$ENDC}
  46.  
  47. {$PUSH}
  48. {$ALIGN MAC68K}
  49. {$LibExport+}
  50.  
  51. {$IFC FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED }
  52.  
  53. CONST
  54.     fCardIsChanged                = 1;                            { Card is Changed field in StatusFlags field of sInfoArray }
  55.     fCkForSame                    = 0;                            { For SearchSRT. Flag to check for SAME sResource in the table.  }
  56.     fCkForNext                    = 1;                            { For SearchSRT. Flag to check for NEXT sResource in the table.  }
  57.     fWarmStart                    = 2;                            { If this bit is set then warm start else cold start. }
  58.  
  59.     stateNil                    = 0;                            { State }
  60.     stateSDMInit                = 1;                            { :Slot declaration manager Init }
  61.     statePRAMInit                = 2;                            { :sPRAM record init }
  62.     statePInit                    = 3;                            { :Primary init }
  63.     stateSInit                    = 4;                            { :Secondary init }
  64.                                                                 {  flags for spParamData  }
  65.     fall                        = 0;                            {  bit 0: set=search enabled/disabled sRsrc's  }
  66.     foneslot                    = 1;                            {     1: set=search sRsrc's in given slot only  }
  67.     fnext                        = 2;                            {     2: set=search for next sRsrc  }
  68.                                                                 {  Misc masks  }
  69.     catMask                        = $08;                            {  sets spCategory field of spTBMask (bit 3)  }
  70.     cTypeMask                    = $04;                            {  sets spCType    field of spTBMask (bit 2)  }
  71.     drvrSWMask                    = $02;                            {  sets spDrvrSW   field of spTBMask (bit 1)  }
  72.     drvrHWMask                    = $01;                            {  sets spDrvrHW      field of spTBMask (bit 0)  }
  73.  
  74.  
  75. TYPE
  76.     SlotIntServiceProcPtr = Register68kProcPtr;  { FUNCTION SlotIntService(sqParameter: LONGINT): INTEGER; }
  77.  
  78.     SlotIntServiceUPP = UniversalProcPtr;
  79.  
  80. CONST
  81.     uppSlotIntServiceProcInfo = $0000B822;
  82.  
  83. FUNCTION NewSlotIntServiceProc(userRoutine: SlotIntServiceProcPtr): SlotIntServiceUPP;
  84.     {$IFC NOT GENERATINGCFM }
  85.     INLINE $2E9F;
  86.     {$ENDC}
  87.  
  88. FUNCTION CallSlotIntServiceProc(sqParameter: LONGINT; userRoutine: SlotIntServiceUPP): INTEGER;
  89.     {$IFC NOT GENERATINGCFM}
  90.     {To be implemented:  Glue to move parameters into registers.}
  91.     {$ENDC}
  92.  
  93. TYPE
  94.     SlotIntQElementPtr = ^SlotIntQElement;
  95.     SlotIntQElement = RECORD
  96.         sqLink:                    Ptr;                                    { ptr to next element }
  97.         sqType:                    INTEGER;                                { queue type ID for validity }
  98.         sqPrio:                    INTEGER;                                { priority }
  99.         sqAddr:                    SlotIntServiceUPP;                        { interrupt service routine }
  100.         sqParm:                    LONGINT;                                { optional A1 parameter }
  101.     END;
  102.  
  103.     SQElemPtr                            = ^SlotIntQElement;
  104.     SpBlockPtr = ^SpBlock;
  105.     SpBlock = RECORD
  106.         spResult:                LONGINT;                                { FUNCTION Result }
  107.         spsPointer:                Ptr;                                    { structure pointer }
  108.         spSize:                    LONGINT;                                { size of structure }
  109.         spOffsetData:            LONGINT;                                { offset/data field used by sOffsetData }
  110.         spIOFileName:            Ptr;                                    { ptr to IOFile name for sDisDrvrName }
  111.         spsExecPBlk:            Ptr;                                    { pointer to sExec parameter block. }
  112.         spParamData:            LONGINT;                                { misc parameter data (formerly spStackPtr). }
  113.         spMisc:                    LONGINT;                                { misc field for SDM. }
  114.         spReserved:                LONGINT;                                { reserved for future expansion }
  115.         spIOReserved:            INTEGER;                                { Reserved field of Slot Resource Table }
  116.         spRefNum:                INTEGER;                                { RefNum }
  117.         spCategory:                INTEGER;                                { sType: Category }
  118.         spCType:                INTEGER;                                { Type }
  119.         spDrvrSW:                INTEGER;                                { DrvrSW }
  120.         spDrvrHW:                INTEGER;                                { DrvrHW }
  121.         spTBMask:                SInt8;                                    { type bit mask bits 0..3 mask words 0..3 }
  122.         spSlot:                    SInt8;                                    { slot number }
  123.         spID:                    SInt8;                                    { structure ID }
  124.         spExtDev:                SInt8;                                    { ID of the external device }
  125.         spHwDev:                SInt8;                                    { Id of the hardware device. }
  126.         spByteLanes:            SInt8;                                    { bytelanes from card ROM format block }
  127.         spFlags:                SInt8;                                    { standard flags }
  128.         spKey:                    SInt8;                                    { Internal use only }
  129.     END;
  130.  
  131.     SInfoRecordPtr = ^SInfoRecord;
  132.     SInfoRecord = RECORD
  133.         siDirPtr:                Ptr;                                    { Pointer to directory }
  134.         siInitStatusA:            INTEGER;                                { initialization E }
  135.         siInitStatusV:            INTEGER;                                { status returned by vendor init code }
  136.         siState:                SInt8;                                    { initialization state }
  137.         siCPUByteLanes:            SInt8;                                    { 0=[d0..d7] 1=[d8..d15] }
  138.         siTopOfROM:                SInt8;                                    { Top of ROM= $FssFFFFx: x is TopOfROM }
  139.         siStatusFlags:            SInt8;                                    { bit 0 - card is changed }
  140.         siTOConst:                INTEGER;                                { Time Out C for BusErr }
  141.         siReserved:                ARRAY [0..1] OF SInt8;                    { reserved }
  142.         siROMAddr:                Ptr;                                    {  addr of top of ROM  }
  143.         siSlot:                    SInt8;                                    {  slot number  }
  144.         siPadding:                ARRAY [0..2] OF SInt8;                    {  reserved  }
  145.     END;
  146.  
  147.     SInfoRecPtr                            = ^SInfoRecord;
  148.     SDMRecordPtr = ^SDMRecord;
  149.     SDMRecord = RECORD
  150.         sdBEVSave:                ProcPtr;                                { Save old BusErr vector }
  151.         sdBusErrProc:            ProcPtr;                                { Go here to determine if it is a BusErr }
  152.         sdErrorEntry:            ProcPtr;                                { Go here if BusErrProc finds real BusErr }
  153.         sdReserved:                LONGINT;                                { Reserved }
  154.     END;
  155.  
  156.     FHeaderRecPtr = ^FHeaderRec;
  157.     FHeaderRec = RECORD
  158.         fhDirOffset:            LONGINT;                                { offset to directory }
  159.         fhLength:                LONGINT;                                { length of ROM }
  160.         fhCRC:                    LONGINT;                                { CRC }
  161.         fhROMRev:                SInt8;                                    { revision of ROM }
  162.         fhFormat:                SInt8;                                    { format - 2 }
  163.         fhTstPat:                LONGINT;                                { test pattern }
  164.         fhReserved:                SInt8;                                    { reserved }
  165.         fhByteLanes:            SInt8;                                    { ByteLanes }
  166.     END;
  167.  
  168. {
  169.  
  170.      Extended Format header block  -  extended declaration ROM format header for super sRsrc directories.    <H2><SM0>
  171.  
  172. }
  173.     XFHeaderRecPtr = ^XFHeaderRec;
  174.     XFHeaderRec = RECORD
  175.         fhXSuperInit:            LONGINT;                                { Offset to SuperInit SExecBlock    <fhFormat,offset> }
  176.         fhXSDirOffset:            LONGINT;                                { Offset to SuperDirectory            <$FE,offset> }
  177.         fhXEOL:                    LONGINT;                                { Psuedo end-of-list                <$FF,nil> }
  178.         fhXSTstPat:                LONGINT;                                { TestPattern }
  179.         fhXDirOffset:            LONGINT;                                { Offset to (minimal) directory }
  180.         fhXLength:                LONGINT;                                { Length of ROM }
  181.         fhXCRC:                    LONGINT;                                { CRC }
  182.         fhXROMRev:                SInt8;                                    { Revision of ROM }
  183.         fhXFormat:                SInt8;                                    { Format-2 }
  184.         fhXTstPat:                LONGINT;                                { TestPattern }
  185.         fhXReserved:            SInt8;                                    { Reserved }
  186.         fhXByteLanes:            SInt8;                                    { ByteLanes }
  187.     END;
  188.  
  189.     SEBlockPtr = ^SEBlock;
  190.     SEBlock = PACKED RECORD
  191.         seSlot:                    UInt8;                                    { Slot number. }
  192.         sesRsrcId:                UInt8;                                    { sResource Id. }
  193.         seStatus:                INTEGER;                                { Status of code executed by sExec. }
  194.         seFlags:                UInt8;                                    { Flags }
  195.         seFiller0:                UInt8;                                    { Filler, must be SignedByte to align on odd boundry }
  196.         seFiller1:                UInt8;                                    { Filler }
  197.         seFiller2:                UInt8;                                    { Filler }
  198.         seResult:                LONGINT;                                { Result of sLoad. }
  199.         seIOFileName:            LONGINT;                                { Pointer to IOFile name. }
  200.         seDevice:                UInt8;                                    { Which device to read from. }
  201.         sePartition:            UInt8;                                    { The partition. }
  202.         seOSType:                UInt8;                                    { Type of OS. }
  203.         seReserved:                UInt8;                                    { Reserved field. }
  204.         seRefNum:                UInt8;                                    { RefNum of the driver. }
  205.         seNumDevices:            UInt8;                                    {  Number of devices to load. }
  206.         seBootState:            UInt8;                                    { State of StartBoot code. }
  207.         filler:                    SInt8;
  208.     END;
  209.  
  210. {   Principle   }
  211. FUNCTION SReadByte(spBlkPtr: SpBlockPtr): OSErr;
  212.     {$IFC NOT GENERATINGCFM}
  213.     INLINE $205F, $7000, $A06E, $3E80;
  214.     {$ENDC}
  215. FUNCTION SReadWord(spBlkPtr: SpBlockPtr): OSErr;
  216.     {$IFC NOT GENERATINGCFM}
  217.     INLINE $205F, $7001, $A06E, $3E80;
  218.     {$ENDC}
  219. FUNCTION SReadLong(spBlkPtr: SpBlockPtr): OSErr;
  220.     {$IFC NOT GENERATINGCFM}
  221.     INLINE $205F, $7002, $A06E, $3E80;
  222.     {$ENDC}
  223. FUNCTION SGetCString(spBlkPtr: SpBlockPtr): OSErr;
  224.     {$IFC NOT GENERATINGCFM}
  225.     INLINE $205F, $7003, $A06E, $3E80;
  226.     {$ENDC}
  227. FUNCTION SGetBlock(spBlkPtr: SpBlockPtr): OSErr;
  228.     {$IFC NOT GENERATINGCFM}
  229.     INLINE $205F, $7005, $A06E, $3E80;
  230.     {$ENDC}
  231. FUNCTION SFindStruct(spBlkPtr: SpBlockPtr): OSErr;
  232.     {$IFC NOT GENERATINGCFM}
  233.     INLINE $205F, $7006, $A06E, $3E80;
  234.     {$ENDC}
  235. FUNCTION SReadStruct(spBlkPtr: SpBlockPtr): OSErr;
  236.     {$IFC NOT GENERATINGCFM}
  237.     INLINE $205F, $7007, $A06E, $3E80;
  238.     {$ENDC}
  239. {   Special   }
  240. FUNCTION SReadInfo(spBlkPtr: SpBlockPtr): OSErr;
  241.     {$IFC NOT GENERATINGCFM}
  242.     INLINE $205F, $7010, $A06E, $3E80;
  243.     {$ENDC}
  244. FUNCTION SReadPRAMRec(spBlkPtr: SpBlockPtr): OSErr;
  245.     {$IFC NOT GENERATINGCFM}
  246.     INLINE $205F, $7011, $A06E, $3E80;
  247.     {$ENDC}
  248. FUNCTION SPutPRAMRec(spBlkPtr: SpBlockPtr): OSErr;
  249.     {$IFC NOT GENERATINGCFM}
  250.     INLINE $205F, $7012, $A06E, $3E80;
  251.     {$ENDC}
  252. FUNCTION SReadFHeader(spBlkPtr: SpBlockPtr): OSErr;
  253.     {$IFC NOT GENERATINGCFM}
  254.     INLINE $205F, $7013, $A06E, $3E80;
  255.     {$ENDC}
  256. FUNCTION SNextSRsrc(spBlkPtr: SpBlockPtr): OSErr;
  257.     {$IFC NOT GENERATINGCFM}
  258.     INLINE $205F, $7014, $A06E, $3E80;
  259.     {$ENDC}
  260. FUNCTION SNextTypeSRsrc(spBlkPtr: SpBlockPtr): OSErr;
  261.     {$IFC NOT GENERATINGCFM}
  262.     INLINE $205F, $7015, $A06E, $3E80;
  263.     {$ENDC}
  264. FUNCTION SRsrcInfo(spBlkPtr: SpBlockPtr): OSErr;
  265.     {$IFC NOT GENERATINGCFM}
  266.     INLINE $205F, $7016, $A06E, $3E80;
  267.     {$ENDC}
  268. FUNCTION SDisposePtr(spBlkPtr: SpBlockPtr): OSErr;
  269.     {$IFC NOT GENERATINGCFM}
  270.     INLINE $205F, $7017, $A06E, $3E80;
  271.     {$ENDC}
  272. FUNCTION SCkCardStat(spBlkPtr: SpBlockPtr): OSErr;
  273.     {$IFC NOT GENERATINGCFM}
  274.     INLINE $205F, $7018, $A06E, $3E80;
  275.     {$ENDC}
  276. FUNCTION SReadDrvrName(spBlkPtr: SpBlockPtr): OSErr;
  277.     {$IFC NOT GENERATINGCFM}
  278.     INLINE $205F, $7019, $A06E, $3E80;
  279.     {$ENDC}
  280. FUNCTION SFindSRTRec(spBlkPtr: SpBlockPtr): OSErr;
  281.     {$IFC NOT GENERATINGCFM}
  282.     INLINE $205F, $701A, $A06E, $3E80;
  283.     {$ENDC}
  284. FUNCTION SFindDevBase(spBlkPtr: SpBlockPtr): OSErr;
  285.     {$IFC NOT GENERATINGCFM}
  286.     INLINE $205F, $701B, $A06E, $3E80;
  287.     {$ENDC}
  288. FUNCTION SFindBigDevBase(spBlkPtr: SpBlockPtr): OSErr;
  289.     {$IFC NOT GENERATINGCFM}
  290.     INLINE $205F, $701C, $A06E, $3E80;
  291.     {$ENDC}
  292. {   Advanced   }
  293. FUNCTION InitSDeclMgr(spBlkPtr: SpBlockPtr): OSErr;
  294.     {$IFC NOT GENERATINGCFM}
  295.     INLINE $205F, $7020, $A06E, $3E80;
  296.     {$ENDC}
  297. FUNCTION SPrimaryInit(spBlkPtr: SpBlockPtr): OSErr;
  298.     {$IFC NOT GENERATINGCFM}
  299.     INLINE $205F, $7021, $A06E, $3E80;
  300.     {$ENDC}
  301. FUNCTION SCardChanged(spBlkPtr: SpBlockPtr): OSErr;
  302.     {$IFC NOT GENERATINGCFM}
  303.     INLINE $205F, $7022, $A06E, $3E80;
  304.     {$ENDC}
  305. FUNCTION SExec(spBlkPtr: SpBlockPtr): OSErr;
  306.     {$IFC NOT GENERATINGCFM}
  307.     INLINE $205F, $7023, $A06E, $3E80;
  308.     {$ENDC}
  309. FUNCTION SOffsetData(spBlkPtr: SpBlockPtr): OSErr;
  310.     {$IFC NOT GENERATINGCFM}
  311.     INLINE $205F, $7024, $A06E, $3E80;
  312.     {$ENDC}
  313. FUNCTION SInitPRAMRecs(spBlkPtr: SpBlockPtr): OSErr;
  314.     {$IFC NOT GENERATINGCFM}
  315.     INLINE $205F, $7025, $A06E, $3E80;
  316.     {$ENDC}
  317. FUNCTION SReadPBSize(spBlkPtr: SpBlockPtr): OSErr;
  318.     {$IFC NOT GENERATINGCFM}
  319.     INLINE $205F, $7026, $A06E, $3E80;
  320.     {$ENDC}
  321. FUNCTION SCalcStep(spBlkPtr: SpBlockPtr): OSErr;
  322.     {$IFC NOT GENERATINGCFM}
  323.     INLINE $205F, $7028, $A06E, $3E80;
  324.     {$ENDC}
  325. FUNCTION SInitSRsrcTable(spBlkPtr: SpBlockPtr): OSErr;
  326.     {$IFC NOT GENERATINGCFM}
  327.     INLINE $205F, $7029, $A06E, $3E80;
  328.     {$ENDC}
  329. FUNCTION SSearchSRT(spBlkPtr: SpBlockPtr): OSErr;
  330.     {$IFC NOT GENERATINGCFM}
  331.     INLINE $205F, $702A, $A06E, $3E80;
  332.     {$ENDC}
  333. FUNCTION SUpdateSRT(spBlkPtr: SpBlockPtr): OSErr;
  334.     {$IFC NOT GENERATINGCFM}
  335.     INLINE $205F, $702B, $A06E, $3E80;
  336.     {$ENDC}
  337. FUNCTION SCalcSPointer(spBlkPtr: SpBlockPtr): OSErr;
  338.     {$IFC NOT GENERATINGCFM}
  339.     INLINE $205F, $702C, $A06E, $3E80;
  340.     {$ENDC}
  341. FUNCTION SGetDriver(spBlkPtr: SpBlockPtr): OSErr;
  342.     {$IFC NOT GENERATINGCFM}
  343.     INLINE $205F, $702D, $A06E, $3E80;
  344.     {$ENDC}
  345. FUNCTION SPtrToSlot(spBlkPtr: SpBlockPtr): OSErr;
  346.     {$IFC NOT GENERATINGCFM}
  347.     INLINE $205F, $702E, $A06E, $3E80;
  348.     {$ENDC}
  349. FUNCTION SFindSInfoRecPtr(spBlkPtr: SpBlockPtr): OSErr;
  350.     {$IFC NOT GENERATINGCFM}
  351.     INLINE $205F, $702F, $A06E, $3E80;
  352.     {$ENDC}
  353. FUNCTION SFindSRsrcPtr(spBlkPtr: SpBlockPtr): OSErr;
  354.     {$IFC NOT GENERATINGCFM}
  355.     INLINE $205F, $7030, $A06E, $3E80;
  356.     {$ENDC}
  357. FUNCTION SDeleteSRTRec(spBlkPtr: SpBlockPtr): OSErr;
  358.     {$IFC NOT GENERATINGCFM}
  359.     INLINE $205F, $7031, $A06E, $3E80;
  360.     {$ENDC}
  361. FUNCTION OpenSlot(paramBlock: ParmBlkPtr; async: BOOLEAN): OSErr;
  362. FUNCTION OpenSlotSync(paramBlock: ParmBlkPtr): OSErr;
  363.     {$IFC NOT GENERATINGCFM}
  364.     INLINE $205F, $A200, $3E80;
  365.     {$ENDC}
  366. FUNCTION OpenSlotAsync(paramBlock: ParmBlkPtr): OSErr;
  367.     {$IFC NOT GENERATINGCFM}
  368.     INLINE $205F, $A600, $3E80;
  369.     {$ENDC}
  370. {   Device Manager Slot Support   }
  371. FUNCTION SIntInstall(sIntQElemPtr: SQElemPtr; theSlot: INTEGER): OSErr;
  372.     {$IFC NOT GENERATINGCFM}
  373.     INLINE $301F, $205F, $A075, $3E80;
  374.     {$ENDC}
  375. FUNCTION SIntRemove(sIntQElemPtr: SQElemPtr; theSlot: INTEGER): OSErr;
  376.     {$IFC NOT GENERATINGCFM}
  377.     INLINE $301F, $205F, $A076, $3E80;
  378.     {$ENDC}
  379. FUNCTION SVersion(spBlkPtr: SpBlockPtr): OSErr;
  380.     {$IFC NOT GENERATINGCFM}
  381.     INLINE $205F, $7008, $A06E, $3E80;
  382.     {$ENDC}
  383. FUNCTION SetSRsrcState(spBlkPtr: SpBlockPtr): OSErr;
  384.     {$IFC NOT GENERATINGCFM}
  385.     INLINE $205F, $7009, $A06E, $3E80;
  386.     {$ENDC}
  387. FUNCTION InsertSRTRec(spBlkPtr: SpBlockPtr): OSErr;
  388.     {$IFC NOT GENERATINGCFM}
  389.     INLINE $205F, $700A, $A06E, $3E80;
  390.     {$ENDC}
  391. FUNCTION SGetSRsrc(spBlkPtr: SpBlockPtr): OSErr;
  392.     {$IFC NOT GENERATINGCFM}
  393.     INLINE $205F, $700B, $A06E, $3E80;
  394.     {$ENDC}
  395. FUNCTION SGetTypeSRsrc(spBlkPtr: SpBlockPtr): OSErr;
  396.     {$IFC NOT GENERATINGCFM}
  397.     INLINE $205F, $700C, $A06E, $3E80;
  398.     {$ENDC}
  399. FUNCTION SGetSRsrcPtr(spBlkPtr: SpBlockPtr): OSErr;
  400.     {$IFC NOT GENERATINGCFM}
  401.     INLINE $205F, $701D, $A06E, $3E80;
  402.     {$ENDC}
  403. {$ENDC}
  404. {$ALIGN RESET}
  405. {$POP}
  406.  
  407. {$SETC UsingIncludes := SlotsIncludes}
  408.  
  409. {$ENDC} {__SLOTS__}
  410.  
  411. {$IFC NOT UsingIncludes}
  412.  END.
  413. {$ENDC}
  414.